package by.ostrovsky.webhousingsystem.controller.providedwork;

import java.util.List;

import org.apache.log4j.Logger;

import by.ostrovsky.webhousingsystem.controller.IOperateController;
import by.ostrovsky.webhousingsystem.dao.DAOFactory;
import by.ostrovsky.webhousingsystem.dao.implementation.idao.IOperateDAO;
import by.ostrovsky.webhousingsystem.exception.CommonException;
import by.ostrovsky.webhousingsystem.hibernate.entity.ProvidedWork;

public class DeleteProvidedWorkController implements
		IOperateController<ProvidedWork, Boolean> {
	private static Logger logger = Logger
			.getLogger(DeleteProvidedWorkController.class);

	@Override
	public List<ProvidedWork> get() throws CommonException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Boolean set(List<ProvidedWork> list) throws CommonException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Boolean delete(List<ProvidedWork> list) throws CommonException {
		DAOFactory factory = DAOFactory.getDAOFactory(DAOFactory.MySQL);
		IOperateDAO<List<ProvidedWork>, Boolean> dao = factory.getProvidedWorkDAO();

		try {
			return dao.delete(list);
		} catch (Exception e) {
			logger.error(e);
		}
		return null;
	}

}
